home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / network / apple.old / AddressXlation.h next >
Text File  |  1996-07-05  |  1KB  |  50 lines

  1. /* 
  2.     AddressXlation.h        
  3.     MacTCP name to address translation routines.
  4.  
  5.     Copyright Apple Computer, Inc. 1988 
  6.     All rights reserved
  7.     
  8. */    
  9.  
  10. #define NUM_ALT_ADDRS    4
  11.  
  12. typedef struct hostInfo {
  13.     int    rtnCode;
  14.     char cname[255];
  15.     unsigned long addr[NUM_ALT_ADDRS];
  16. };
  17.  
  18. typedef enum AddrClasses {
  19.     A = 1,
  20.     NS,
  21.     CNAME = 5,
  22.     lastClass = 65535
  23. }; 
  24.  
  25. typedef struct cacheEntryRecord {
  26.     char *cname;
  27.     unsigned short type;
  28.     enum AddrClasses aclass;
  29.     unsigned long ttl;
  30.     union {
  31.         char *name;
  32.         ip_addr addr;
  33.     } rdata;
  34. };
  35.  
  36. typedef pascal void (*EnumResultProcPtr)(struct cacheEntryRecord *cacheEntryRecordPtr, char *userDataPtr);
  37.  
  38. typedef pascal void (*ResultProcPtr)(struct hostInfo *hostInfoPtr, char *userDataPtr);
  39.  
  40. extern OSErr OpenResolver(char *fileName);
  41.  
  42. extern OSErr StrToAddr(char *hostName, struct hostInfo *hostInfoPtr, ResultProcPtr ResultProc, char *userDataPtr);
  43.  
  44. extern OSErr AddrToStr(unsigned long addr, char *addrStr);
  45.  
  46. extern OSErr EnumCache(EnumResultProcPtr enumResultProc, char *userDataPtr);
  47.  
  48. extern OSErr AddrToName(ip_addr addr, struct hostInfo *hostInfoPtr, ResultProcPtr ResultProc, char *userDataPtr);
  49.  
  50. extern OSErr CloseResolver();